Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

toxic-predicate-functions

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

toxic-predicate-functions

predicate functions

  • 0.4.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

toxic-predicate-functions

Build Status Coverage Status npm dependency Status devDependency Status Greenkeeper badge

predicate functions collection

get started

npm install toxic-predicate-functions --save

if you are using flow, you should import our flow defination, by adding this to your .flowconfig.

[ignore]

[include]

[libs]
./node_modules/toxic-predicate-functions/lib/index.flow.js
[options]

[lints]

doc

defined

src/index.js:5-7

to check whether the object is defined or not

Parameters

  • obj any

Returns boolean

isVoid

src/index.js:11-13

is void element or not ? Means it will return true when val is undefined or null

Parameters

  • obj any

Returns boolean

isArray

src/index.js:17-19

to check whether a variable is array

Parameters

  • arr any

Returns boolean

isFunction

src/index.js:24-26

is it a function or not

Parameters

  • obj any

Returns boolean

isObject

src/index.js:31-34

is it an object or not

Parameters

  • obj any

Returns boolean

isNumber

src/index.js:38-40

to tell you if it's a real number

Parameters

  • obj any

Returns boolean

isNumeric

src/index.js:44-46

to tell you if the val can be transfer into number

Parameters

  • obj any

Returns boolean

isInteger

src/index.js:50-52

is it an interget or not

Parameters

  • num any

Returns boolean

isEmpty

src/index.js:57-65

return true when the value is "", {}, [], 0, null, undefined, false.

Parameters

  • obj any

Returns boolean

isEvent

src/index.js:69-71

is it an event or not

Parameters

  • obj any

Returns boolean

isBlob

src/index.js:75-77

is it a blob

Parameters

  • obj any

Returns boolean

isFile

src/index.js:81-83

is it a file uploaded by user through file inpue

Parameters

  • obj any

Returns boolean

isDate

src/index.js:87-89

is it a date

Parameters

  • obj any

Returns boolean

isString

src/index.js:93-96

is it a string

Parameters

  • str any

Returns boolean

isBoolean

src/index.js:100-102

is Boolean or not

Parameters

  • bool any

Returns boolean

isPromise

src/index.js:106-108

is a promise or not

Parameters

  • obj any

Returns boolean

isPrimitive

src/index.js:112-114

is Primitive type or not, whick means it will return true when data is number/string/boolean/undefined/null

Parameters

  • val any

Returns boolean

isUrl

src/index.js:118-120

is it an url, but this test require the url to have an protocol

Parameters

  • str any

Returns boolean

isNode

src/index.js:124-131

to test if a HTML node

Parameters

  • obj any

Returns boolean

isElement

src/index.js:135-143

to test if a HTML element

Parameters

  • obj any

Returns boolean

isChildNode

src/index.js:147-152

check if node A is node B's parent or not

Parameters

Returns boolean

isPosterityNode

src/index.js:156-167

check if node B is node A's posterrity or not

Parameters

Returns boolean

isHTMLString

src/index.js:171-173

check if the string is an HTMLString

Parameters

Returns boolean

isError

src/index.js:177-179

check if is an error

Parameters

  • val any

Returns boolean

isRegExp

src/index.js:183-185

check if is an RegExp

Parameters

  • val any

Returns boolean

Keywords

FAQs

Package last updated on 02 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc